namespace Gl.SettingsManager.Providers.DbSettings
{
	internal class DbConstants
	{
		internal class Sections
		{
			public const string TableName = "[GlSettingsManager_Sections]";

			public const string TypeNameColumn = "[TypeName]";
			public const string ContextColumn = "[Context]";
			public const string ApplicationNameColumn = "[ApplicationName]";
			public const string IdColumn = "[Id]";

			public const string PrimaryKey = "[Primary_GlSettingsManager_Sections_Id]";
		}

		internal class Settings
		{
			public const string TableName = "[GlSettingsManager_Settings]";

			public const string NameColumn = "[Name]";
			public const string ValueColumn = "[Value]";
			public const string SectionIdColumn = "[SectionId]";
			public const string IdColumn = "[Id]";

			public const string ForeingKey = "[Fk_Settings_SectionId_Sections_Id]";
		}

		/// <summary>
		/// SectionsTable, SettingsTable
		/// </summary>
		public static string CheckTablesExistense =
			string.Format(@"SELECT OBJECT_ID('{0}', 'U') SectionsTable
							,OBJECT_ID('{1}', 'U') SettingsTable",
			Sections.TableName, Settings.TableName);
	}
}
